/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BLL;

import DBH.DBHelper;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

/**
 *
 * @author Huy
 */
public class B_thuchi {
        private DBHelper obj = new DBHelper();
    private Vector v;
    private Integer number;
    private String idnv;
    private String tongtien ;
   public B_thuchi(){}
   public B_thuchi(Integer number,String idnv,String tongtien){
       this.number = number;
        this.idnv=idnv;
        this.tongtien = tongtien;
    }
    public  Vector getAllthuchi() throws SQLException
    {
        Vector v = new Vector();
        try 
        {
            ResultSet rs = obj.executeQuery("sp_getAllthuchi");
            while(rs.next())
            {    B_thuchi t = new B_thuchi();
                t.setNumber(rs.getInt(1));
                t.setIdnv(rs.getString(2));
                t.setTongtien(rs.getString(3));
                
                v.add(t);  
            }
        } 
        catch(SQLException sqle) 
        {            
        }
        return v;        
    }
        public int Insertthuchi(B_thuchi t) throws SQLException
    {
        int i=0;
        try
        {
            Vector paramList=new Vector();
            paramList.add(t.getIdnv());
            paramList.add(t.getTongtien());
            
            i=DBHelper.executeUpdate("sp_Insertthuchi",paramList);
        }
        catch(SQLException sqlex)
        {
            
        }
        return i;
    }

    /**
     * @return the number
     */
    public Integer getNumber() {
        return number;
    }

    /**
     * @param number the number to set
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     * @return the idnv
     */
    public String getIdnv() {
        return idnv;
    }

    /**
     * @param idnv the idnv to set
     */
    public void setIdnv(String idnv) {
        this.idnv = idnv;
    }

    /**
     * @return the tongtien
     */
    public String getTongtien() {
        return tongtien;
    }

    /**
     * @param tongtien the tongtien to set
     */
    public void setTongtien(String tongtien) {
        this.tongtien = tongtien;
    }
    /**
     * @return the idnv
 
 * 
 * /
 * */
}